<template>
  <div>
    <h2>单选框</h2>
    男:<input type="radio" name="sex" :checked="gender === '男'" @input="handerRadio('男')">
    女:<input type="radio" name="sex" :checked="gender === '女'" @input="handerRadio('女')">
  </div>
</template>

<script>
export default {
  name: 'InputRadio',
  props: ['gender', 'updtaRadio'],
  methods: {
    handerRadio(value) {
      this.updtaRadio(value)
    }
  },
}
</script>

<style scoped></style>